using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Edge.Common.ComponentModel;

namespace Dune.Web.Controls
{
    public partial class AccordionMenu : System.Web.UI.UserControl
    {
        private ICollection<NavigationItem> ds;

        public ICollection<NavigationItem> DataSourse
        {
            get { return ds; }
            set { ds = value; }
        }

        public string CurrentId
        {
            get
            {
                foreach (NavigationItem item in ds)
                {
                    if (item.Current)
                        return item.UrlPath;
                }
                return string.Empty;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            rprMenu.DataSource = DataSourse;
            rprMenu.DataBind();
        }
    }
}